/**
 * Copyright 2013 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.common.utils;
import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.JsonGenerationException;

import com.viettel.core.entities.cms.Users;

/**
 *  Mo ta muc dich cua lop (interface)
 *  @author: ToanTM1
 *  @version: 2.1
 *  @since: 20-09-2013 - 13:04:57
 */
public class JackSonUtil {
	
	public static String objectToJSON(Object object){
		try {
			ObjectMapper mapper = new ObjectMapper();
			return (String) mapper.writeValueAsString(object);
		}catch(IOException e){
			
		}
		return null;
	}
	
	public static void main(String[] args) {

		Users us=new Users();
		us.setEmail("toan@gmail.com");
		System.out.println(objectToJSON(us));
	}	
	
}
